package main

import (
	"fmt"
)

//司机张三，李四， 汽车 宝马，奔驰
//1 -张三 开奔驰
//2 -李四 开宝马

// Benz 奔驰类
type Benz struct {
}

func (b *Benz) Run() {
	fmt.Println("Benz is running...")
}

// BMW 宝马类
type BMW struct {
}

func (m *BMW) Run() {
	fmt.Println("BMW is running...")
}

// ZhangSan 司机张三
type ZhangSan struct {
}

func (zs *ZhangSan) DriveBenz(benz Benz) {
	fmt.Println("ZhangSan Drive Benz....")
	benz.Run()
}

// DriveBMW 张三如果想开宝马
func (zs ZhangSan) DriveBMW(bmw BMW) {
	fmt.Println("ZhangSan Drive BMW ")
	bmw.Run()
}

// LiSi  司机李四
type LiSi struct {
}

func (ls LiSi) DriveBMW(bmw BMW) {
	fmt.Println("LiSi Drive BMW....")
	bmw.Run()
}

// 李四如果想开奔驰
func (ls LiSi) DriveBenz(benz Benz) {
	fmt.Println("Lisi Drive Benz...")
	benz.Run()
}

func main() {

	benz := Benz{}
	bmw := BMW{}

	//1-张三 开奔驰
	zhangsan := ZhangSan{}
	zhangsan.DriveBenz(benz)
	zhangsan.DriveBMW(bmw)

	//2-李四开宝马
	lisi := LiSi{}
	lisi.DriveBMW(bmw)
	lisi.DriveBenz(benz)
}
